export const LIST_VIEW = 'list'
export const CHART_VIEW = 'chart'
export const TYPE_INCOME = 'income'
export const TYPE_OUTCOME = 'outcome'
export const padLeft =(n)=>{
  return n < 10 ? '0' + n :n
}

export const range = (size,startAt = 0)=>{
  const arr =[]
  for(let i = 0; i<size;i++){
    arr[i] = startAt +i
  }
  return arr
}


export const parseToYearAndMonth = (str)=>{
  const date = str ? new Date(str): new Date()
  return {
    year: date.getFullYear(),
    month: date.getMonth()+1
  }
}

export const items = [
  {
    "id":1,
    "title": "去云南旅游",
    "price":200,
    "date": "2020-10-11",
    "cid":1
  },
  {
    "id":2,
    "title": "去欧洲旅游",
    "price":500,
    "date": "2020-09-11",
    "cid":1
  },
  {
    "id":3,
    "title": "基金",
    "price":800,
    "date": "2020-12-11",
    "cid":2
  }
]

export const categories = {
  "1":{
    "id":"1",
    "name":"旅行",
    "type":"outcome",
    "iconName":"ios-plane"
  },
  "2":{
    "id":"2",
    "name":"理财",
    "type":"income",
    "iconName":"logo-yen"
  }
}

export const newItem = {
  "id": 5,
  "title": "新项目",
  "price":800,
  "date": "2020-11-11",
  "cid":2
}